package com.wanxi.util;

import java.io.*;

public class Tool {
    private Tool() {

    }

    public static OutputStream getFileOutputStream(String path, String fileName) {
        File dir = new File(path);
        dir.mkdirs();
        File file = new File(dir, fileName);
        OutputStream outputStream = null;
        try {
            outputStream = new FileOutputStream(file);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        return outputStream;
    }

    public static InputStream getInputStream(String path, String fileName) {
        File file = new File(path, fileName);
        InputStream inputStream = null;

        try {
            inputStream = new FileInputStream(file);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        return inputStream;
    }
}
